# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=ktnef
pkgver=22.04.3
pkgrel=0
pkgdesc="API for handling TNEF data"
# armhf blocked by extra-cmake-modules
# s390x blocked by kcalendarcore
# riscv64 blocked by polkit -> kcalutils
arch="all !armhf !s390x !riscv64"
url="https://kontact.kde.org/"
license="LGPL-2.0-or-later"
depends_dev="
	kcalendarcore-dev
	kcalutils-dev
	kcontacts-dev
	ki18n-dev
	qt5-qtbase-dev
	"
makedepends="$depends_dev
	extra-cmake-modules
	samurai
	"
source="https://download.kde.org/stable/release-service/$pkgver/src/ktnef-$pkgver.tar.xz"
subpackages="$pkgname-dev $pkgname-lang"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib
	cmake --build build
}

check() {
	cd build
	CTEST_OUTPUT_ON_FAILURE=TRUE ctest
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}
sha512sums="
66afc1366280a6f3c2a450b8c44845cb64b67c84fe875b5b43defa0ea25f254bea2345a29d132dda6a28dee8cd97b2768d3e93664acdf1e7ba19e73a61a38e40  ktnef-22.04.3.tar.xz
"
